package com.ukao.cashregister.ui.createOrders;


import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.amap.api.maps2d.AMap;
import com.amap.api.maps2d.CameraUpdateFactory;
import com.amap.api.maps2d.LocationSource;
import com.amap.api.maps2d.SupportMapFragment;
import com.amap.api.maps2d.model.BitmapDescriptorFactory;
import com.amap.api.maps2d.model.LatLng;
import com.amap.api.maps2d.model.LatLngBounds;
import com.amap.api.maps2d.model.Marker;
import com.amap.api.maps2d.model.MarkerOptions;
import com.amap.api.maps2d.model.MyLocationStyle;
import com.amap.api.services.core.AMapException;
import com.amap.api.services.core.LatLonPoint;
import com.amap.api.services.core.PoiItem;
import com.amap.api.services.poisearch.PoiResult;
import com.amap.api.services.poisearch.PoiSearch;
import com.amap.api.services.poisearch.PoiSearch.OnPoiSearchListener;
import com.bigkoo.pickerview.OptionsPickerView;
import com.mcxtzhang.commonadapter.rv.OnItemClickListener;
import com.ukao.cashregister.R;
import com.ukao.cashregister.adapter.AddressAdapter;
import com.ukao.cashregister.bean.addressBean;
import com.ukao.cashregister.base.MvpFragment;
import com.ukao.cashregister.bean.AddressList;
import com.ukao.cashregister.consts.Constant;
import com.ukao.cashregister.consts.SaveParamets;
import com.ukao.cashregister.dialog.DialogTool;
import com.ukao.cashregister.dialog.EditSexDialogFragment;
import com.ukao.cashregister.eventbus.ChooseTimeEvent;
import com.ukao.cashregister.eventbus.UserInfoEvent;
import com.ukao.cashregister.listener.MyOnItemClickListener;
import com.ukao.cashregister.listener.OnDialogSureClickListener;
import com.ukao.cashregister.pesenter.AddAddressPesenter;
import com.ukao.cashregister.utils.AmapUtil;
import com.ukao.cashregister.utils.CheckUtils;
import com.ukao.cashregister.utils.ConstUtils;
import com.ukao.cashregister.utils.L;
import com.ukao.cashregister.utils.T;
import com.ukao.cashregister.view.AddressView;
import com.ukao.cashregister.widget.ClearEditText;
import com.ukao.cashregister.widget.DividerDecoration;

import org.greenrobot.eventbus.Subscribe;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

import static com.amap.api.maps2d.model.BitmapDescriptorFactory.fromResource;
import static com.ukao.cashregister.R.id.right_add_address_doorplate_tv;
import static com.ukao.cashregister.R.id.right_add_address_name_et;
import static com.ukao.cashregister.R.id.search_btn;
import static com.ukao.cashregister.R.id.search_edit;


/**
 * 添加地址
 */
public class UserInfoRightAddAddressFragment extends MvpFragment<AddAddressPesenter> implements AddressView, LocationSource,
        AMapLocationListener{

    Unbinder unbinder;
    @BindView(R.id.back_layout)
    LinearLayout backLayout;
    @BindView(R.id.right_add_address_submit_btn)
    Button rightAddAddressSubmitBtn;
    @BindView(right_add_address_name_et)
    ClearEditText mNameEt;
    @BindView(R.id.right_add_address_phone_et)
    ClearEditText mPhoneEt;
    @BindView(R.id.right_add_address_province_tv)
    TextView rightAddAddressProvinceTv;
    @BindView(R.id.right_add_address_province_layout)
    LinearLayout rightAddAddressProvinceLayout;
    @BindView(R.id.search_btn)
    Button searchBtn;
    @BindView(search_edit)
    ClearEditText searchEdit;
    @BindView(right_add_address_doorplate_tv)
    TextView rightAddAddressDoorplateTv;
    @BindView(R.id.right_add_address_doorplate_layout)
    LinearLayout rightAddAddressDoorplateLayout;
    @BindView(R.id.recycler_view)
    RecyclerView mRecyclerView;
    @BindView(R.id.sex)
    TextView mSex;
    @BindView(R.id.map_layout)
    LinearLayout mapLayout;
    private String uploadingsex = "";
    @BindView(R.id.back_msg)
    TextView backMsg;

    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;
    private AMap mMap;
    private AMapLocation amapLocation;
    private OnLocationChangedListener mListener;
    private AMapLocationClient mlocationClient;
    private AMapLocationClientOption mLocationOption;
    private PoiSearch.Query query;
    private static final int FILL_COLOR = Color.argb(10, 0, 0, 180);
    private ArrayList<PoiItem> poiIData ;
    private LatLonPoint mLatLonPoint;
    private String city = "";
    private AddressAdapter mAddressAdapter;
    private ArrayList<addressBean> options1Items;
    private ArrayList<ArrayList<String>> options2Items;
    private ArrayList<ArrayList<ArrayList<String>>> options3Items;

    private OptionsPickerView mProvinceDialog;
    private List<addressBean> provinceCityLists;
    public String regionalId;
    private String userid;
    private String strName;
    private String strPhone;
    private String strProvince;
    private String strAddress;
    private String strRightAddAddressDoorplateTv;
    private String selectSex;
    private MarkerOptions markerOption;
    private LatLngBounds.Builder bounds;
    private AddressList mAddressBean;
    private String longitud="";
    private String latitude="";
    private String def="1";
    private String addressId;/*编辑地址id*/
    private boolean isvipEnter;


    public static UserInfoRightAddAddressFragment newInstance(String param1, String param2, String userid, String usesex,boolean isvipEnter) {
        UserInfoRightAddAddressFragment fragment = new UserInfoRightAddAddressFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        args.putString(ARG_PARAM3, userid);
        args.putString(ARG_PARAM4, usesex);
        args.putBoolean(ARG_PARAM5, isvipEnter);
        fragment.setArguments(args);
        return fragment;
    }

    public static UserInfoRightAddAddressFragment newInstance(Serializable param1) {
        UserInfoRightAddAddressFragment fragment = new UserInfoRightAddAddressFragment();
        Bundle args = new Bundle();
        args.putSerializable(ARG_PARAM5, param1);
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            Serializable mSerializable = getArguments().getSerializable(ARG_PARAM5);
            if ( mSerializable instanceof AddressList  ){
                mAddressBean= (AddressList)mSerializable;
            }
            if (CheckUtils.isNull(mAddressBean)){
                mParam1 = getArguments().getString(ARG_PARAM1,"");
                mParam2 = getArguments().getString(ARG_PARAM2,"");
                userid = getArguments().getString(ARG_PARAM3, "");
                selectSex = getArguments().getString(ARG_PARAM4, "");
                isvipEnter= getArguments().getBoolean(ARG_PARAM5,false);

            }

        }
    }

    @Override
    protected AddAddressPesenter createPresenter() {
        return new AddAddressPesenter(this);
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_right_add_address, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onLazyInitView(@Nullable Bundle savedInstanceState) {
        super.onLazyInitView(savedInstanceState);
        initView();

        initListener();
    }




    @Override
    protected void initView() {
        fillData();
       poiIData = new ArrayList<>();
        mvpPresenter.getAddressProvinceData(_mActivity);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(activity));
        mAddressAdapter = new AddressAdapter(activity, poiIData);
        mRecyclerView.addItemDecoration(new DividerDecoration(getActivity(), DividerDecoration.VERTICAL_LIST));
        mRecyclerView.setAdapter(mAddressAdapter);

    }

    private void fillData() {
        if (CheckUtils.isNull(mAddressBean)){
            mNameEt.setText(mParam2);
            mPhoneEt.setText(mParam1);
            mSex.setText(selectSex);
            getsex(selectSex);
            if (isvipEnter){backMsg.setText("会员信息");}
        }else{

            addressId=mAddressBean.getId();
            mNameEt.setText(mAddressBean.getName());
            mPhoneEt.setText(mAddressBean.getPhone());
            uploadingsex=mAddressBean.getSex()+"";
            mSex.setText(getsex(mAddressBean.getSex()));
            userid=mAddressBean.getUserId()+"";
            regionalId=mAddressBean.getRegionalId()+"";
            rightAddAddressProvinceTv.setText(mAddressBean.getRegionalDesc());
            searchEdit.setText(CheckUtils.isEmptyString(mAddressBean.getDetail()));
            longitud=CheckUtils.isEmptyString(mAddressBean.getLongitud());
            latitude=CheckUtils.isEmptyString(mAddressBean.getLatitude());

        }

    }

    @Override
    protected void initListener() {
        super.initListener();
        mAddressAdapter.setOnItemClickListener(mOnItemClickListener);

    }

    private OnItemClickListener  mOnItemClickListener=new MyOnItemClickListener() {

        @Override
        public void onItemClick(ViewGroup viewGroup, View view, Object o, int i) {
            super.onItemClick(viewGroup, view, o, i);
            PoiItem item = (PoiItem) o;
            if (item.getDistance()!=1) {
                searchEdit.setText(item.getSnippet());
                item.setDistance(1);
                latitude =String.valueOf(mLatLonPoint.getLatitude());
                longitud=String.valueOf(mLatLonPoint.getLongitude());
                List<PoiItem> mData = mAddressAdapter.getDatas();
                for (int j = 0; j < mData.size(); j++) {
                    if (i != j) {
                        mData.get(j).setDistance(0);

                    }
                }

                mAddressAdapter.notifyDataSetChanged();
            }



        }
    };

    @Override
    public void onSupportVisible() {
        super.onSupportVisible();
        setUpMapIfNeeded();
    }

    @Override
    public void onSupportInvisible() {
        super.onSupportInvisible();
        deactivate();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        deactivate();
        unbinder.unbind();

    }


    @OnClick({R.id.sex_layout, R.id.back_layout, R.id.right_add_address_submit_btn, R.id.right_add_address_name_et, R.id.right_add_address_province_layout, search_btn, right_add_address_doorplate_tv, R.id.right_add_address_doorplate_layout})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back_layout:
                finish();
                break;
            case R.id.right_add_address_submit_btn:

                strName = getText(mNameEt);
                strPhone = getText(mPhoneEt);
                strProvince = getText(rightAddAddressProvinceTv);/*省份*/
                strAddress = getText(searchEdit);/*地址*/
                strRightAddAddressDoorplateTv = getText(rightAddAddressDoorplateTv);/*门牌号*/
                if (CheckUtils.isEmpty(strName)) {
                    T.show("请填写联系人");
                    return;
                } else if (CheckUtils.isEmpty(strPhone)) {
                    T.show("请填写联系人电话");
                    return;
                } else if (CheckUtils.isEmpty(strProvince)) {
                    T.show("请选择省市区");
                    return;
                } else if (CheckUtils.isEmpty(strAddress)) {
                    T.show("请填写地址");
                    return;
                }
                HashMap mHashMap = new HashMap<String, String>();
                mHashMap.put("accessToken", SaveParamets.getToken(_mActivity));
                mHashMap.put("userId", userid);
                mHashMap.put("phone", strPhone);
                mHashMap.put("name", strName);
                mHashMap.put("sex", uploadingsex);
                mHashMap.put("regionalId", regionalId + "");/*区域id*/
                mHashMap.put("regionalDesc", strProvince);/*省市区描述*/
                mHashMap.put("detail", " " + strAddress + " " + strRightAddAddressDoorplateTv);/*省市区描述*/
                mHashMap.put("latitude", latitude);/*省市区描述*/
                mHashMap.put("longitude", longitud);/*省市区描述*/
                mHashMap.put("def",def);/* 默认状态：1:默认，0:非默认*/
                L.i("mHashMap="+mHashMap);
                if (CheckUtils.isNull(mAddressBean)){
                    mvpPresenter.placeOrderData(Constant.createParameter(mHashMap));
                }else{
                    mHashMap.put("id", addressId);
                    mvpPresenter.userAddressEdit(Constant.createParameter(mHashMap));
                }
                break;
            case R.id.sex_layout:
                EditSexDialogFragment editSex = new EditSexDialogFragment();
                Bundle bundle = new Bundle();
                bundle.putString("sex", getText(mSex));
                editSex.setArguments(bundle);
                editSex.setOnSureClickListener(mOnDialogSureClickListener);
                editSex.show(getChildFragmentManager(), EditSexDialogFragment.class.getName());
                break;
            case right_add_address_name_et:
                break;
            case R.id.right_add_address_province_layout:  /*选择省份*/
                if (mProvinceDialog == null) {
                    mProvinceDialog = DialogTool.getSingleton().ShowCityPickerView(_mActivity, mOnOptionsSelectListener);
                    mProvinceDialog.setPicker(options1Items, options2Items, options3Items);//三级选择器
                    mProvinceDialog.show();
                } else {
                    mProvinceDialog.show();
                }


                break;
            case search_btn:  /*搜索周边*/

                String keyWord = getText(searchEdit);
                if (keyWord.isEmpty())return;
                showProgressDialog();
                doSearchQuery(activity, keyWord, mLatLonPoint, ConstUtils.CURRENT_PAGE, ConstUtils.PAGE_SIZE, city);
                break;

            case right_add_address_doorplate_tv:


                break;
            case R.id.right_add_address_doorplate_layout:
                break;
        }
    }


    private OnDialogSureClickListener mOnDialogSureClickListener = new OnDialogSureClickListener() {
        @Override
        public void onSureItemClick(Object message) {
            String str = (String) message;
            mSex.setText(str);
            getsex(str);
        }
    };

    private void getsex(String message) {
        switch (message) {
            case "女":
                uploadingsex = "2";
                break;
            case "男":
                uploadingsex = "1";
                break;
            case "未知":
                uploadingsex = "0";

                break;
        }
    }
    private String getsex(int sex) {
        String  useSex="";
        switch (sex) {
            case 2:
                useSex="女";
                break;
            case 1:
                useSex="男";

                break;
            case 0:
                useSex="未知";
                break;
        }
        return  useSex ;
    }

    @Subscribe
    public void onEvent(UserInfoEvent event) {
        if (event.getMessage().equals(UserInfoEvent.Message.CLOSE))
            finish();
    }


    private OptionsPickerView.OnOptionsSelectListener mOnOptionsSelectListener = new OptionsPickerView.OnOptionsSelectListener() {


        @Override
        public void onOptionsSelect(int options1, int options2, int options3, View v) {

            //返回的分别是三个级别的选中位置
            String tx = options1Items.get(options1).getPickerViewText() + " " +
                    options2Items.get(options1).get(options2) + " " +
                    options3Items.get(options1).get(options2).get(options3);
            regionalId = provinceCityLists.get(options1).getChildren().get(options2).getChildren().get(options3).getValue()+"";
            rightAddAddressProvinceTv.setText(tx);

        }
    };

    /**
     * 开始进行poi搜索
     */
    public void doSearchQuery(Context mContext, String keyWord, LatLonPoint mLatLonPoint, int currentPage, int pageSize, String city) {


        query = new PoiSearch.Query(keyWord, "", city);// 第一个参数表示搜索字符串，第二个参数表示poi搜索类型，第三个参数表示poi搜索区域（空字符串代表全国）
        query.setPageSize(pageSize);
        query.setPageNum(currentPage);

        if (mLatLonPoint != null) {
            PoiSearch poiSearch = new PoiSearch(mContext, query);
            poiSearch.setOnPoiSearchListener(mOnPoiSearchListener);
            poiSearch.setBound(new PoiSearch.SearchBound(mLatLonPoint, 5000, true));//
            // 设置搜索区域为以lp点为圆心，其周围5000米范围
            poiSearch.searchPOIAsyn();// 异步搜索
        }
    }


    @Override
    protected boolean useEventBus() {
        return true;

    }


    /**
     * 初始化AMap对象
     */
    private void setUpMapIfNeeded() {
        if (mMap == null) {
            mMap = ((SupportMapFragment) getChildFragmentManager()
                    .findFragmentById(R.id.map)).getMap();
            setUpMap();
        }
    }


    /**
     * 设置一些amap的属性
     */
    private void setUpMap() {
        mMap.setLocationSource(this);// 设置定位监听
        mMap.getUiSettings().setMyLocationButtonEnabled(true);// 设置默认定位按钮是否显示
        mMap.setMyLocationEnabled(true);// 设置为true表示显示定位层并可触发定位，false表示隐藏定位层并不可触发定位，默认是false
        mMap.setOnMarkerClickListener(mOnMarkerClickListener);// 设置点击marker事件监听器
        setupLocationStyle();


    }

    private void setupLocationStyle() {
        // 自定义系统定位蓝点
        MyLocationStyle myLocationStyle = new MyLocationStyle();
        // 自定义定位蓝点图标
        myLocationStyle.myLocationIcon(
                fromResource(R.drawable.navi_map_gps_locked));
        // 自定义精度范围的圆形边框颜色
        myLocationStyle.strokeColor(getResources().getColor(R.color.blue));
        //自定义精度范围的圆形边框宽度
        myLocationStyle.strokeWidth(2);
        // 设置圆形的填充颜色
        myLocationStyle.radiusFillColor(FILL_COLOR);
        // 将自定义的 myLocationStyle 对象添加到地图上
        mMap.setMyLocationStyle(myLocationStyle);
    }


    private AMap.OnMarkerClickListener mOnMarkerClickListener = new AMap.OnMarkerClickListener() {
        @Override
        public boolean onMarkerClick(Marker marker) {
            if (mMap != null) {
                marker.showInfoWindow();
            }

            return false;
        }
    };


    /**
     * 定位成功后回调函数
     */
    @Override
    public void onLocationChanged(AMapLocation amapLocation) {
        if (mListener != null && amapLocation != null) {
            if (amapLocation != null
                    && amapLocation.getErrorCode() == 0) {
                this.amapLocation = amapLocation;
               String   location=AmapUtil.getLocationStr(amapLocation);
                String   slelectlocation=getText(rightAddAddressProvinceTv);
                /*位置是空闲的就设置*/
                if (CheckUtils.isEmpty(slelectlocation)){
                  String strProvince=amapLocation.getProvince().replace("省","");
                    String strCity=amapLocation.getCity().replace("市","");
                    String strDistrict=amapLocation.getDistrict();
                    rightAddAddressProvinceTv.setText(strProvince+" "+strCity+" "+strDistrict);
                    regionalId=amapLocation.getAdCode();


                }

                L.i("location="+location);
                mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
                if (CheckUtils.isEmpty(latitude)&&CheckUtils.isEmpty(longitud)){
                    latitude=amapLocation.getLatitude()+"";
                    longitud=amapLocation.getLongitude()+"";

                }
                mLatLonPoint = new LatLonPoint(amapLocation.getLatitude(), amapLocation.getLongitude());
                String   mProvince=amapLocation.getProvince();/*省份*/
                city = amapLocation.getCity();
                doSearchQuery(activity, "", mLatLonPoint, ConstUtils.CURRENT_PAGE, ConstUtils.PAGE_SIZE, city);

            } else {

                T.show("定位失败");

            }
        }
    }


    /**
     * 激活定位
     */
    @Override
    public void activate(OnLocationChangedListener listener) {
        mListener = listener;
        if (mlocationClient == null) {
            mlocationClient = new AMapLocationClient(activity);
            mLocationOption = new AMapLocationClientOption();
            //设置定位监听
            mlocationClient.setLocationListener(this);
            //设置为高精度定位模式
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
            //设置定位参数
            mLocationOption.setOnceLocation(true);//可选，设置是否单次定位。默认是false
            mLocationOption.setOnceLocationLatest(true);//可选，设置是否等待wifi刷新，默认为false.如果设置为true,会自动变为单次定位，持续定位时不要使用
            mlocationClient.setLocationOption(mLocationOption);
            // 此方法为每隔固定时间会发起一次定位请求，为了减少电量消耗或网络流量消耗，
            // 注意设置合适的定位时间的间隔（最小间隔支持为2000ms），并且在合适时间调用stopLocation()方法来取消定位请求
            // 在定位结束后，在合适的生命周期调用onDestroy()方法
            // 在单次定位情况下，定位无论成功与否，都无需调用stopLocation()方法移除请求，定位sdk内部会移除
            mlocationClient.startLocation();
        }
    }

    /**
     * 停止定位
     */
    @Override
    public void deactivate() {
        mListener = null;
        if (mlocationClient != null) {
            //mlocationClient.stopLocation();
            mlocationClient.onDestroy();
        }
        mlocationClient = null;
    }



    OnPoiSearchListener   mOnPoiSearchListener=new OnPoiSearchListener() {
        @Override
        public void onPoiSearched(PoiResult result, int rcode) {
              dismissProgressDialog();
            if (rcode == AMapException.CODE_AMAP_SUCCESS) {
                if (result != null && result.getQuery() != null) {  // 搜索poi的结果
                    if (result.getQuery().equals(query)) {// 是否是同一条
                        ArrayList<PoiItem> poiItems = result.getPois();

                        if (poiItems != null && poiItems.size() > 0) {
                            poiIData.clear();
                            poiIData.addAll(poiItems);
                            mAddressAdapter.setDatas(poiIData);
                            mapLayout.setVisibility(View.VISIBLE);
                            fillMarker(poiIData);
                        }else{
                            T.show("没有搜索到相关数据");
                        }

                    }
                } else {

                    T.show("没有搜索到相关数据");


                }
            }
        }
        @Override
        public void onPoiItemSearched(PoiItem poiItem, int i) {

        }
    };



    private void fillMarker(ArrayList<PoiItem> poiItemList) {
        mMap.clear();
        bounds= new LatLngBounds.Builder();
        Bitmap imgMarker = BitmapFactory.decodeResource(getResources(), R.drawable.poi_marker_red);
        int  i=0;
        for (PoiItem item : poiItemList) {
            i=i+1;
            LatLonPoint mLatLonPoint = item.getLatLonPoint();
            LatLng mLatLng = new LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude());

            markerOption= new MarkerOptions().icon(BitmapDescriptorFactory
                    .fromBitmap(Constant.createDrawable(String.valueOf(i),imgMarker)))
                    .position(mLatLng)
                    .snippet(item.getSnippet())
                    .draggable(true);
            mMap.addMarker(markerOption);
            bounds.include(mLatLng);


        }
        if (amapLocation != null) {
            LatLng mLatLng = new LatLng(amapLocation.getLatitude(), amapLocation.getLongitude());
            bounds.include(mLatLng);
        }

        mSex.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (!_mActivity.isFinishing())
                    mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds.build(),50));
            }
        }, 500);



    }


    @Override
    public void addressDataSucceed() {

        ChooseTimeEvent.postNoData(ChooseTimeEvent.Message.sendaddress );
        finish();
    }

    @Override
    public void addressDataFailure(String message) {
        T.show(message);
    }

    @Override
    public void editAddressSucceed(String msg) {
        T.show(msg);
        ChooseTimeEvent.postNoData(ChooseTimeEvent.Message.sendaddress);
        finish();
    }


    @Override
    public void cityDataSucceed(ArrayList<addressBean> provinceCityLists, ArrayList<addressBean> options1Items, ArrayList<ArrayList<String>> options2Items, ArrayList<ArrayList<ArrayList<String>>> options3Items) {
        this.options1Items = options1Items;
        this.options2Items = options2Items;
        this.options3Items = options3Items;
        this.provinceCityLists = provinceCityLists;


    }
}
